// pages/thumbnail/thumbnail.js

Page({

  /**
   * 页面的初始数据
   */
  data: {
    date: new Date().getTime(),
    isPreview: false,
    pics: [{
      title: '蒲公英',
      filename: '01.jpg',
      thumbname: "01s.jpg"
    }, {
      title: '火棘',
      filename: '02.jpg',
      thumbname: "02s.jpg"
    }, {
      title: '海桐',
      filename: '03.jpg',
      thumbname: "03s.jpg"
    }, {
      title: '小蜡',
      filename: '04.jpg',
      thumbname: "04s.jpg"
    }, {
      title: '苏门白酒草',
      filename: '05.jpg',
      thumbname: "05s.jpg"
    }, {
      title: '枣花',
      filename: '06.jpg',
      thumbname: "06s.jpg"
    }]
  },
  preview: function (e) {
    var index = e.target.dataset.index
    var pre_path = this.data.pics[index].filename
    this.setData({
      pre_path: pre_path,
      isPreview: true
    })
  },
  cancel: function () {
    this.setData({
      isPreview: false
    })
  },
})